#ifndef PartBoundCondType_H
#define PartBoundCondType_H

#include <cmath>
#include <cstdlib>
#include <iostream>

#include "CellParticles.h"
#include "../Input/PicParams.h"

//
//int function( Particle<dim> &particle, int ipart, int direction, double limit_pos )
//    returns :
//        0 if particle ipart have to be deleted from current process (MPI or BC)
//        1 otherwise
//
//keep_particle = :  0 delete; 1 MPI change; 2 move to other cell; 3 still in the cell

template<int dim>
inline int refl_particle(Particle<dim> &particle, double limit_pos, int i_dim)
{
    //std::cout<<"refl condition is used, before postion is  "<<particle.position[i_dim]<<endl;
    particle.position[i_dim] = limit_pos - particle.position[i_dim];
    particle.velocity[i_dim] = -particle.velocity[i_dim];
    //std::cout<<"refl condition is used, after postion is  "<<particle.position[i_dim]<<endl;
    return 3;
}

template<int dim>
inline int supp_particle(Particle<dim> &particle, double limit_pos, int i_dim)
{
    return 0;
}


template<int dim>
inline int periodic_particle(Particle<dim> &particle, double limit_pos, int i_dim)
{
    return 1;
}


template<int dim>
inline int thermalize_particle(Particle<dim> &particle, double limit_pos, int i_dim)
{
    return 0;
}

#endif
